/*
 * Project: Sudoku Hint Engine for Android
 * Copyright (C) 2010-2013 Emanuel Moecklin
 * 
 * Available under the terms of the Lesser General Public License (LGPL)
 */
package com.onegravity.sudoku.solver.checks;

import com.onegravity.sudoku.solver.accumulator.HintsAccumulator;
import com.onegravity.sudoku.solver.accumulator.StopHintProductionException;
import com.onegravity.sudoku.solver.data.Grid;

/**
 * This class checks if the puzzle has no pencil marks at all and computes them accordingly.
 * If the puzzle contains at least one pencil mark no Hint will be produced. 
 * @author Emanuel Moecklin
 */
public class MissingPencilMarksProducer extends PencilMarksHintsProducer {

	public MissingPencilMarksProducer(Grid solvedGrid) {
		super(solvedGrid);
	}

	@Override
	public void getHints(Grid grid, HintsAccumulator accu) throws StopHintProductionException {
		if (processGrid(grid) && mToBeAdded.size()>0) {
			// no pencil marks at all
			MissingPencilMarksHint message = new MissingPencilMarksHint(mToBeAdded);
            accu.add(message);
		}
    }

}